import requests from '@/plugins/requests'
// 1.1工单状态列表
export const taskStatusAPI = () => requests({
  url: '/api/task-service/task/allTaskStatus'
})
// 1.2 工单搜索
export const searchTaskAPI = (body) => requests({
  url: '/api/task-service/task/search',
  params: body
})
// 1.3 获取所有工单类型
export const allTaskTypeAPI = () => requests({
  url: '/api/task-service/taskType/list'
})
// 1.4 根据售货机获取运营人员列表
export const operatorListAPI = (innerCode) => requests({
  url: `/api/user-service/user/operatorList/${innerCode}`
})
// 获取售货机货道详情
export const channelListAPI = (innerCode) => requests({
  url: `/api/vm-service/channel/channelList/${innerCode}`
})
// 补货详情
export const taskDetailsAPI = (taskId) => requests({
  url: `/api/task-service/taskDetails/${taskId}`
})
// 创建工单
export const creatTaskAPI = (data) => requests({
  url: '/api/task-service/task/create',
  method: 'POST',
  data
})
// 重新创建工单
// 获取工单详情
export const taskInfoAPI = (taskId) => requests({
  url: `/api/task-service/task/taskInfo/${taskId}`
})
// 获取补货预警值
export const supplyAlertValueAPI = () => requests({
  url: '/api/task-service/task/supplyAlertValue'
})
// 设置自动补货工单阈值
export const autoSupplyConfigAPI = (alertValue) => requests({
  url: '/api/task-service/task/autoSupplyConfig',
  method: 'POST',
  data: {
    alertValue
  }
})
// 取消工单
export const concleTaskAPI = (body) => requests({
  url: `/api/task-service/task/cancel/${body.taskId}`,
  method: 'POST',
  data: body
})
// 根据售货机获取维修人员列表
export const repairerListAPI = (innerCode) => requests({
  url: `/api/user-service/user/repairerList/${innerCode}`
})
